﻿/*
 * This class provides an example of using contracts on an interface 
 * All classes that implement the interface will inherit the contracts 
 * Refer to the code contracts documentation for more information
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace Shweet.Repository
{
    [ContractClass(typeof(ITeamsContract))]
    public interface ITeams
    {
        void Add(List<Team> teamsToFollow);
        void Remove(List<Team> teamsToUnFollow);
        List<Team> GetAll();
        List<Team> Discover();
    }

    [ContractClassFor(typeof(ITeams))]
    sealed class ITeamsContract : ITeams
    {
        void ITeams.Add(List<Team> teamsToFollow)
        {
            Contract.Requires(teamsToFollow != null);
            Contract.Requires(teamsToFollow.All(team => team != null));
            
            throw new NotImplementedException();
        }

        void ITeams.Remove(List<Team> teamsToUnFollow)
        {
            Contract.Requires(teamsToUnFollow != null);
            Contract.Requires(teamsToUnFollow.All(team => team != null));

            throw new NotImplementedException();
        }

        List<Team> ITeams.GetAll()
        {
            Contract.Ensures(Contract.Result<List<Team>>() != null);

            throw new NotImplementedException();
        }

        List<Team> ITeams.Discover()
        {
            Contract.Ensures(Contract.Result<List<Team>>() != null);

            throw new NotImplementedException();
        }
    }

}
